#ifndef DEFAULTALLOCATER_H_
#define DEFAULTALLOCATER_H_

/*
 *	<p>	DefaultAllocater Stragy </p>
 *	@author:	Kenvi.Luo
 *	@email:		kenvi.luo@gmail.com
 *	@date:		2007/08/06
 *	@modify:	N/A
 *	----------------------------
 *	@samples:
 *		using namepsace FURY::STRAGY;
 *		...;
 *		DefaultAllocater<Product*> allocater;
 *		Product *product = allocater.allocater();
 *		allocater.free(product);
 */

#include "../threadsafe/Guard.h"
#include "../threadsafe/CriticalLock.h"

namespace FURY
{
	namespace STRAGY
	{
		template<typename T, typename Lock = CriticalLock, int once_allocate_size = 4, int max_allocate_size = 128	>
		struct DefaultAllocater
		{
			T* allocate()
			{
 				return new T;
 			};
 			void free(T* obj)
 			{
 				delete obj;
 			};
		 };
	};
};

#endif /*DEFAULTALLOCATER_H_*/
